﻿@model IEnumerable<Chbl.Models.Game>

@{
    ViewBag.Title = "Index";
}

<h2>Index</h2>

<p>
    @Html.ActionLink("Create New", "Create")
</p>
<table>
    <tr>
        <th>
            Гости
        </th>
        <th>
            Хозяева
        </th>
        <th>
            Дата
        </th>
        <th>
            Игра
        </th>
        <th>
            Тур
        </th>
        <th>
            Дивизион
        </th>
        <th>
            Очки принимающей команды
        </th>
        <th>
            Очки гостевой команды
        </th>
        <th>
            Счет
        </th>
        <th></th>
    </tr>

@foreach (var item in Model) {
    <tr>
        <td>
            @Html.DisplayFor(modelItem => item.HomeTeam.Name)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.RoadTeam.Name)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.Date)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.GameOrder)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.TourNumber)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.SeasonDivision.Division.Name)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.HomeScore)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.RoadScore)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.Score)
        </td>
        <td>
            @Html.ActionLink("Edit", "Edit", new { id=item.GameId }) |
            @Html.ActionLink("Details", "Details", new { id=item.GameId }) |
            @Html.ActionLink("Delete", "Delete", new { id=item.GameId })
        </td>
    </tr>
}

</table>
